package demo1;

public class Student implements Comparable<Student>{
    public String name;
    protected int age;

    public Student(String name,int age){
        this.name=name;
        this.age=age;
    }

//    public demo1.Student compareTo()

    public int compareTo(Student o) {
        return this.age-o.age;
    }
}
class Next extends Student{
    public Next(String name, int age) {
        super(name, age);
    }
    public int num1=10;
    protected int num2=20;
}
